package com.mycompany.common;

import java.sql.Connection;
import java.util.List;

import com.mycompany.common.jdbc.ConnectionDatabase;

/**
 * Created by My Company.
 * User: loitran
 * Date: Feb 29, 2012
 * Time: 11:19:56 AM
 * com.mycompany.common.
 */
public abstract class AbstractDao<T> {
	
	/*Create Connect*/
	public Connection connect = ConnectionDatabase.getInstance();
	/**
	 * Allows you to retrieve an object via ID
	 * @param id
	 * @return
	 */	
	public abstract	T find(long id);
	
	/**
	 * Allows you to retrieve all object 
	 * @param id
	 * @return
	 */	
	public abstract	List<T> findAll();
	
	/**
	 * Creates an entry in the database
	 * relative to an object
	 * @param obj
	 */
	public abstract T create(T obj);
	
	/**
	 * Allows to update a data entry in the 
	 * @param obj
	 */
	public abstract T update(T obj);
	
	/**
	 * Allows the removal of an entry in the base
	 * @param obj
	 */
	public abstract void delete(T obj);

}
